﻿var list = new List<int>();

for (int i = 1; i <= 100; i++)
{
    list.Add(new Random().Next(0,1000));    
}

list.Sort((a, b) => b-a);
Console.WriteLine("When sorted:");
list.ForEach(sp =>
{
    Console.Write(sp + " ");
});

Console.WriteLine();
Console.WriteLine($"Sum: {list.Sum()}");
Console.WriteLine($"Average: {list.Average()}");